package jkoa.core;

import cn.hutool.core.util.StrUtil;

public class Response {
	public int statusCode;
	public Object body;

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    public void send(Object data) {
        if (data instanceof String) {
            setBody(data);
        } else {
            setBody(StrUtil.toString(data));
        }
    }
}